﻿CREATE TABLE [dbo].[VideoFile]
(
	[VideoFileID]	 	uniqueidentifier NOT NULL,
    [FilePath]         	varchar(900) NOT NULL,
    [OriginalFileName]	varchar(900) NOT NULL,
    [CurrentFileName]	varchar(900) NOT NULL,
    [DateAdded]        	datetime NOT NULL,
    [VideoLength]		time NULL,
    [AudioLength]		time NULL,
    [FileSize]         	bigint NULL,
    [VideoWidth]       	smallint NULL,
    [VideoHeight]      	smallint NULL,
    [AudioSubType]		uniqueidentifier NULL,
    [VideoSubType]		uniqueidentifier NULL,
    [AudioBitRate]     	int NULL,
    [VideoBitRate]     	int NULL,
    [FourCC]           	varchar(4) NULL,
    [FrameRate]        	float NULL,
    [FileType]         	varchar(5) NOT NULL,
    [IsVBR]            	bit NULL,
    [IsDeleted]			bit NOT NULL DEFAULT ((0)),
    [IsPrivate]			bit NOT NULL DEFAULT ((0)),
    [IsReplacement]		bit NOT NULL DEFAULT ((0)),
    [MediaClassID]		tinyint NOT NULL,
    CONSTRAINT [PK_VideoFile] PRIMARY KEY([VideoFileID]),
    CONSTRAINT [UQ_VideoFile_FilePath]	UNIQUE ([FilePath]),
	CONSTRAINT [FK_VideoFile_MediaClassID] FOREIGN KEY([MediaClassID]) REFERENCES [dbo].[MediaClass]([MediaClassID])
)
